package com.xzy.shop.dao.impl;

import com.xzy.shop.dao.BuyedDao;
import com.xzy.shop.util.JDBCUtils;
import org.springframework.jdbc.core.JdbcTemplate;

public class BuyedDaoImpl implements BuyedDao {
    JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
    @Override
    public int findOrders(int status, String uid) {
        String sql = "select count(*) from buyed where status = ? and uid = ?";
        int integer = template.queryForObject(sql, Integer.class, status, uid);
        return integer;
    }
}
